package com.ies.ieschool.client.module.academic.view.data;

import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;

public class SubjectSessionData extends DataSource {
	
	private static SubjectSessionData instance = null;  
	  
    public static SubjectSessionData getInstance() {  
        if (instance == null) {  
            instance = new SubjectSessionData("SubjectSessionData_DS");  
        }  
        return instance;  
    }
    public SubjectSessionData(String id) {  
    	  
        setID(id);  
        setRecordXPath("/List/session");  
        DataSourceIntegerField pkField = new DataSourceIntegerField("pk");  
        pkField.setHidden(true);  
        pkField.setPrimaryKey(true);  
  
        
  
        DataSourceTextField sessionNameField = new DataSourceTextField("sessionName");  
        sessionNameField.setRequired(true);  
  
        DataSourceTextField teacherNameField = new DataSourceTextField("teacherName");  
        teacherNameField.setRequired(true);  
          
        setFields(pkField, sessionNameField, teacherNameField);  
  
        setDataURL("ds/test_data/session.data.xml");  
        setClientOnly(true);  
    }
}
